import request from '@/utils/request'

// 查询智能柜列表
export function listCabinetGroup(query) {
  return request({
    url: '/wms/cabinetGroup/list',
    method: 'get',
    params: query
  })
}

// 查询库区列表
export function cabinetGroupTree(query) {
  return request({
    url: '/wms/cabinetGroup/cabinetGroupTree',
    method: 'get',
    params: query
  })
}

// 初始化
export function initBean(data) {
    return request({
        url: '/wms/cabinetGroup/initBean',
        method: 'post',
        data: data
    })
}

// 查询智能柜详细
export function getCabinetGroup(id) {
  return request({
    url: '/wms/cabinetGroup/' + id,
    method: 'get'
  })
}

// 新增智能柜
export function addCabinetGroup(data) {
  return request({
    url: '/wms/cabinetGroup',
    method: 'post',
    data: data
  })
}

// 修改智能柜
export function updateCabinetGroup(data) {
  return request({
    url: '/wms/cabinetGroup',
    method: 'put',
    data: data
  })
}

// 删除智能柜
export function delCabinetGroup(id) {
  return request({
    url: '/wms/cabinetGroup/' + id,
    method: 'delete'
  })
}

// 同步智能柜货道
export function syncCabinet(sncode,groupId) {
  return request({
    url: '/openApi/cabinetModels/' + sncode+'/'+groupId,
    method: 'get'
  })
}
